(defun C:RMTEXT (/ text-entities entity)
  (setq text-entities (list "TEXT" "MTEXT" "RTEXT" "ATTDEF"))
  (setq entity (entnext))
  (while entity
    (if (member (cdr (assoc 0 (entget entity))) text-entities)
      (entdel entity)
    )
    (setq entity (entnext entity))
  )
  (princ)
)